//
//  CellOfVidioImg.m
//  ProjectA_ManualGuest
//
//  Created by dingcong on 16/6/22.
//  Copyright © 2016年 丁聪. All rights reserved.
//

#import "CellOfVidioImg.h"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
@implementation CellOfVidioImg


- (void)dealloc{
    [_bigPic release];
    [_smallLable release];
    [_model release];
    [_handModel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self creat];
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
    
    
}


- (void)creat{
    
    self.bigPic = [[UIImageView alloc]init];
   
    [self.contentView addSubview:self.bigPic];
    
    [self.bigPic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(8);
        make.leading.equalTo(self.contentView.mas_leading).offset(8);
        make.height.equalTo(self.contentView.mas_height).offset( - 16);
        make.width.offset(SCREEN_WIDTH - 16);
        
    }];
    self.bigPic.layer.cornerRadius = 5;
    self.bigPic.layer.masksToBounds = YES;
    [self.bigPic release];
    
    
    self.smallLable = [[UILabel alloc]init];
    
    
    
    [self.contentView addSubview:self.smallLable];
    
    [self.smallLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.bigPic.mas_leading).offset(7);
        make.bottom.equalTo(self.bigPic.mas_bottom).offset( -7);
        make.height.offset(15);
        make.width.offset(SCREEN_WIDTH - 30);
        
    }];
    
    [self.smallLable release];
    
    
    
    
}

- (void)setModel:(VidioModel *)model{
    
    [self.bigPic sd_setImageWithURL:[NSURL URLWithString:model.host_pic] placeholderImage:nil];
    
    self.smallLable.text = model.subject;
    
    self.smallLable.textColor = [UIColor whiteColor];
    
    
    
}

- (void)setHandModel:(HandPanitedModel *)handModel{
    
    [self.bigPic sd_setImageWithURL:[NSURL URLWithString:handModel.pic] placeholderImage:nil];
    NSLog(@"%@", handModel.pic);
    self.smallLable.text = handModel.subject;
    self.smallLable.textColor = [UIColor whiteColor];
    
    
    
    
    
}
@end
